﻿<UserControl x:Class="Arch.Samples.RiaServices.Views.Todos.TodoEdit"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:df="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
    xmlns:helper="clr-namespace:Arch.Samples.RiaServices.Helpers"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <helper:DataContextProxy x:Name="ContextProxy" />
    </UserControl.Resources>
    <df:DataForm CurrentItem="{Binding CurrentItem}" CommandButtonsVisibility="None" x:Name="LayoutRoot">
        <StackPanel>
            <df:DataField>
                <TextBox Text="{Binding Title, Mode=TwoWay}" />
            </df:DataField>
            <df:DataField>
                <TextBox Text="{Binding Description, Mode=TwoWay}" MinHeight="200" MaxHeight="500" />
            </df:DataField>
            <df:DataField>
                <ComboBox ItemsSource="{Binding Source.ViewModel.GlobalCategories, Source={StaticResource ContextProxy}}" 
                          DisplayMemberPath="Name" SelectedItem="{Binding GlobalCategory, Mode=TwoWay}" />
            </df:DataField>
            <df:DataField>
                <ComboBox ItemsSource="{Binding Source.ViewModel.SubCategories, Source={StaticResource ContextProxy}}" 
                          DisplayMemberPath="Name" SelectedItem="{Binding SubCategory, Mode=TwoWay}" />
            </df:DataField>            
        </StackPanel>
    </df:DataForm>
</UserControl>
